package Satic;

/**
 * @author chihb
 * @create-time 2024/6/22 11:25
 * @description
 */
public class StaticTest {
    public static void main(String[] args) {
        //被static修饰的变量可以被类名直接访问
        StaticDemo.name="ss";
        //没有被static修饰的变量只能是类的实例化对象来访问
        StaticDemo staticDemo=new StaticDemo();
        staticDemo.age=12;
        staticDemo.name="222";
        System.out.println(StaticDemo.name);
        StaticDemo.eat();
    }
}
